package com.liao.badminton.vo;

import com.liao.badminton.code.BaseField;
import io.swagger.annotations.ApiModelProperty;
import java.lang.String;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.entity.StipulationLevel;
/**
* @author liaocheng
* @date 2024-11-09
* description:等级划分规则表
*/
@Data
public class StipulationLevelVo  extends BaseField {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "群id")
    private Long groupId;

    @ApiModelProperty(value = "赢家名称")
    private String levelName;

    @ApiModelProperty(value = "最低下限包含：比如前5名>=5")
    private BigDecimal scopeLow;

    @ApiModelProperty(value = "最大上限不包含：比如<0")
    private BigDecimal scopeHigh;

    @ApiModelProperty(value = "1.胜率 2.获得奖励 3.名次")
    private Integer stipulationType;

    @ApiModelProperty(value = "stipulation_type=3时，名次排序类型：1.胜率 2.获得奖励 3.净胜分")
    private Integer rankType;

    @ApiModelProperty(value = "作用：比如前5名，要让5分，后5名，要+5分")
    private BigDecimal effect;

    @ApiModelProperty(value = "是否有效：0:无效，1:有效")
    private Integer useStatus;

    private List<Long> delIds;  //批量删除ids

    public static StipulationLevelVo invertToVo(StipulationLevel stipulationLevel){
        StipulationLevelVo vo = new StipulationLevelVo();
        BaseField.invert(stipulationLevel, vo);
        vo.setId(stipulationLevel.getId());
        vo.setGroupId(stipulationLevel.getGroupId());
        vo.setLevelName(stipulationLevel.getLevelName());
        vo.setScopeLow(stipulationLevel.getScopeLow());
        vo.setScopeHigh(stipulationLevel.getScopeHigh());
        vo.setStipulationType(stipulationLevel.getStipulationType());
        vo.setRankType(stipulationLevel.getRankType());
        vo.setEffect(stipulationLevel.getEffect());
        vo.setUseStatus(stipulationLevel.getUseStatus());
        return vo;
    }
}
